/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-08-03
 * Time: 20:15
 */


class Solution {
    public int removeElement(int[] nums, int val) {
        int n = nums.length;
        int left = 0;
        for (int right = 0; right < n; right++) {
            if (nums[right] != val) {
                nums[left] = nums[right];
                left++;
            }
        }
        return left;
    }
}
public class Test {
    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] array = {3,2,2,3};
        solution.removeElement(array,2);

    }
}


